<link rel='stylesheet' type='text/css' href='<?php echo $this->baseUrl() . '/public/css/admin.css'?>'/>
<div class='wrap-content'>
    <div class='wrap-title'>
        <h1>
            Top Fans Configurations
        </h1>
        <a href='javascript:void(0)' class='gray-button view-page'>
            <img src='<?php echo $this->baseUrl() . '/images/left-arrow.png'?>'/>
            View Page
        </a>
    </div>
    <div class='wrap-form'>
        <form method='post' id='cofig_form' enctype="multipart/form-data">
            <?php $errors = $this->errors ?>
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("DESCRIPTION") ?>
                </label>
                <div class='wrap-input'>
                    <textarea id='description' name='description' rows='20'>
                        <?php echo $this->page_info['description'] ?>
                    </textarea>
                    <?php if (isset($errors['description'])): ?>
                        <ul class='errors'>
                            <?php foreach ($errors['description'] as $error): ?>
                            <li>
                                <?php echo $error ?>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>                    
                </div>
            </div>
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("BANNER"); ?>
                </label>
                <div class='wrap-input'>
                    <input type='file' name='banner_image' id='banner_image'/>
                    <?php if (isset($errors['banner_image'])): ?>
                        <ul class='errors'>
                            <?php foreach ($errors['banner_image'] as $error): ?>
                            <li>
                                <?php echo $error ?>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>                    
                </div>
            </div>
            <?php if (!empty($this->page_info['banner_image'])): ?>
                <div class='wrap-field' id='banner_image_display'>
                    <label></label>
                    <img src='<?php echo $this->baseUrl() . UPLOAD_URL . "/" . $this->page_info['banner_image']?>' width='250px'/>
                    <a href='javascript:void(0)' class='delete-image' onclick='deleteBanner()'>X</a>
                    <input type='hidden' name='hdd_banner_image' id='hdd_banner_image' value='<?php echo $this->page_info['banner_image']?>'/>                    
                </div>
            <?php endif; ?>
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("FANGATE"); ?>
                </label>
                <div class='wrap-input'>
                    <input type='file' name='fangate_image' id='fangate_image'/>                    
                    <?php if (isset($errors['fangate_image'])): ?>
                        <ul class='errors'>
                            <?php foreach ($errors['fangate_image'] as $error): ?>
                            <li>
                                <?php echo $error ?>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>                      
                </div>
            </div>
            <?php if (!empty($this->page_info['fangate_image'])): ?>
                <div class='wrap-field' id='fangate_image'>
                    <label></label>
                    <img src='<?php echo $this->baseUrl() . UPLOAD_URL . "/" . $this->page_info['fangate_image']?>' width='250px'/>
                    <a href='javascript:void(0)' class='delete-image'>X</a>
                </div>
                <input type='hidden' name='hdd_fangate_image' id='hdd_fangate_image' value='<?php echo $this->page_info['fangate_image']?>'/>
            <?php endif; ?>
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("POST_POINT"); ?>
                </label>
                <div class='wrap-input'>
                    <input type='text' name='post_point' id='post_point' value='<?php echo $this->page_info['post_point']?>'/>
                    <?php if (isset($errors['post_point'])): ?>
                        <ul class='errors'>
                            <?php foreach ($errors['post_point'] as $error): ?>
                            <li>
                                <?php echo $error ?>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>                         
                </div>
            </div>    
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("COMMENT_POINT"); ?>
                </label>
                <div class='wrap-input'>
                    <input type='text' name='comment_point' id='comment_point' value='<?php echo $this->page_info['comment_point']?>'/>
                    <?php if (isset($errors['comment_point'])): ?>
                        <ul class='errors'>
                            <?php foreach ($errors['comment_point'] as $error): ?>
                            <li>
                                <?php echo $error ?>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>                        
                </div>
            </div>       
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("LIKE_POINT"); ?>
                </label>
                <div class='wrap-input'>
                    <input type='text' name='like_point' id='like_point'value='<?php echo $this->page_info['comment_point']?>'/>
                    <?php if (isset($errors['like_point'])): ?>
                        <ul class='errors'>
                            <?php foreach ($errors['like_point'] as $error): ?>
                            <li>
                                <?php echo $error ?>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>                         
                </div>
            </div>          
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("VOTE_POINT"); ?>
                </label>
                <div class='wrap-input'>
                    <input type='text' name='vote_point' id='like_point'value='<?php echo $this->page_info['vote_point']?>'/>
                    <?php if (isset($errors['vote_point'])): ?>
                        <ul class='errors'>
                            <?php foreach ($errors['vote_point'] as $error): ?>
                            <li>
                                <?php echo $error ?>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>                         
                </div>
            </div>
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("BACKGROUND_COLOR"); ?>
                </label>
                <div class='wrap-input'>
                    <div id='display_background' style='background-color:<?php echo $this->page_info['background_color'] ?>'></div>
                    <input type='hidden' name='background_color' id='background_color'value='<?php echo $this->page_info['background_color']?>'/>
                    <?php if (isset($errors['background_color'])): ?>
                        <ul class='errors'>
                            <?php foreach ($errors['background_color'] as $error): ?>
                            <li>
                                <?php echo $error ?>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>                       
                </div>
            </div>      
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("UPDATE_FREQUENCY"); ?>
                </label>
                <div class='wrap-input'>
                    <input type='text' name='update_frequency' id='update_frequency'value='<?php echo $this->page_info['update_frequency']?>'/>
                    <?php if (isset($errors['update_frequency'])): ?>
                        <ul class='errors'>
                            <?php foreach ($errors['update_frequency'] as $error): ?>
                            <li>
                                <?php echo $error ?>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>                       
                </div>             
            </div>  
            <div class='wrap-field'>
                <label>
                    <?php echo $this->translate->_("RESET_PERIOD"); ?>
                </label>
                <div class='wrap-input'>
                    <input type='radio' name='reset_period' value='w' <?php echo $this->page_info['reset_period'] == 'w' ? "checked" : "" ?>>Week</input>
                    <input type='radio' name='reset_period' value='m' <?php echo $this->page_info['reset_period'] == 'm' ? "checked" : "" ?>>Month</input>
                </div>             
            </div>                
            <input type='hidden' name='id_social_page' value='<?php echo $this->id_social_page?>'/>
            <div class='wrap-field'>
                <label></label>
                <div class='wrap-input'>
                    <input type='submit' id='submit' value='Save'/>
                </div>
            </div>
        </form>
    </div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
<script src='<?php echo $this->baseUrl() . "/public/tinymce/tinymce.min.js"?>'></script>
<?php echo $this->partial("/_partial/initHead.phtml", "facebook"); ?>
<script>
    tinyMCE.init({
        mode : "textareas",
    });
    var pid = '<?php echo $this->id_social_page?>';
</script>
<script src='<?php echo $this->baseUrl() . '/public/javascript/admin.js' ?>'></script>
<link rel='stylesheet' type='text/css' href='<?php echo $this->baseUrl() . '/public/color_picker/css/colorpicker.css'?>'/>
<script type='text/javascript' src='<?php echo $this->baseUrl() . '/public/color_picker/js/colorpicker.js'?>'></script>
<script>
    $("#display_background").ColorPicker({
        onChange: function(hsb, hex, rgb) {
            $("#display_background").css("background", hex);
            $("#background_color").val(hex);
        }
    });
    $("#display_background").ColorPickerSetColor('<?php echo $this->page_info['background_color']?>');
</script>
